import request from '@/utils/request'

// 查询商城满减活动列表
export function listFullDiscount(query) {
  return request({
    url: '/manager/promotion/fullDiscount/list',
    method: 'get',
    params: query
  })
}

// 查询商城满减详细
export function getFullDiscount(id) {
  return request({
    url: '/manager/promotion/fullDiscount/' + id,
    method: 'get'
  })
}

// 新增商城满减活动
export function addFullDiscount(data) {
  return request({
    url: '/manager/promotion/fullDiscount',
    method: 'post',
    data: data
  })
}

// 修改商城满减活动
export function updateFullDiscount(data) {
  return request({
    url: '/manager/promotion/fullDiscount',
    method: 'put',
    data: data
  })
}

// 删除商城满减活动
export function delFullDiscount(id) {
  return request({
    url: '/manager/promotion/fullDiscount/' + id,
    method: 'delete'
  })
}

// 启用商城满减活动
export function enableFullDiscount(id) {
  return request({
    url: '/manager/promotion/fullDiscount/enable/' + id,
    method: 'post'
  })
}

// 关闭商城优惠券
export function closeFullDiscount(ids) {
  return request({
    url: '/manager/promotion/fullDiscount/close/' + ids,
    method: 'post'
  })
}
